<template>
    <el-select 
        v-model="model" 
        :placeholder="option.placeholder || '请选择'" 
        :style="{ width: option.width }" 
        clearable
        >
        <el-option
            v-for="(select, index) in option.selects"
            :key="index"
            :label="select.label"
            :value="select.value"
            />
    </el-select>
</template>
<script>
export default {
    name: 'iv-select',
    props: {
        value: [String, Number, Boolean],
        option: {
            type: Object,
            default: () => {}
        }
    },
    computed: {
        model: {
            get() {
                return this.value
            },
            set(val) {
                this.$emit("update:value", val)
            }
        }
    }
}
</script>
